package XmlLoader;
/* class Position : store information of position in 2 dimension */
public class Position 
{
	public int x = 0;
	public int y = 0;
	public int index = -1;
	
	public Position() {}
	
	public Position(int x, int y) {
		this.x = x;
		this.y = y;
	}
	
	public Position(int x, int y, int index) {
		this.x = x;
		this.y = y;
		this.index = index;
	}
	
	public double ACT001_countDist(Position p) {
		return Math.sqrt((this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y));
	}
	
	public boolean ACT002_isInRange(Position posMin, Position posMax) {
		return (this.x >= posMin.x && x <= posMax.x) && (this.y >= posMin.y && this.y <= posMax.y);
	}
	
	public int getX() {
		return this.x;
	}
	
	public int getY() {
		return this.y;
	}
	
	public int getIndex() {  
        return this.index;  
    }  
  
    public void setIndex(int index) {  
        this.index = index;  
    }  
}
